#!/bin/bash

sudo gedit /etc/default/grub

if ! grep -q 'GRUB_CMDLINE_LINUX="iommu=pt"' /etc/default/grub; then
    sudo sed -i '/^GRUB_CMDLINE_LINUX=/c\GRUB_CMDLINE_LINUX="iommu=pt"' /etc/default/grub
fi

sudo update-grub

echo "重启生效"
